
import java.util.* ;
import java.io.* ;
public class ass3{

   public static void main(String[] args){

 	 read_From_File_Example(args[0],args[1]);

   }


   public static void read_From_File_Example(String inputFilename, String outputFilename){

	   try {
        System.out.println("Reading from file " + inputFilename);
       	BufferedReader br = new BufferedReader(new FileReader(new File(inputFilename)));
		String line = br.readLine();
		while (line != null)
		{
			StringTokenizer st = new StringTokenizer(line, " ");
			String act = st.nextToken();
			if (act.equals("init"))
			{
				
				// Do the Init
                                // Write to the output file that pizzeria has been  initialized
			
				}
				
			
			if (act.equals("insert"))
			{
				// Do the ExtractMin
			}
			if (act.equals("Insert"))
			{
			
				String name = st.nextToken();
				String time = st.nextToken();
				int dist = Integer.valueOf(st.nextToken()).intValue();
				int amount = Integer.valueOf(st.nextToken()).intValue();
				// Do the insert
			}
			if (act.equals("getNextOrders"))
			{
				String time = st.nextToken();
				int num=Integer.valueOf(time).intValue();
                                // Extract the relevant orders
				// Write to the output file the orders
			}
			if (act.equals("printOrders"))
			{
				
				// Write all the orders to the output file
			}
				
			
			line = br.readLine();
		}

	}
	catch (IOException e)
	{
		System.err.println("Problems with the file");
		e.printStackTrace();
		}

}

   // appends a line to the end of the file
    private static void appendToFile(String outputFilename, String line) {

        try {
        	File outFile = new File(outputFilename);
        	FileWriter ofw;
        	if (outFile.exists()) {
             ofw = new FileWriter(outFile,true);
        	} else {
        		ofw =  new FileWriter(outFile);
        	}

          	ofw.write(line + " ");
          	ofw.close();
        }
        catch (Exception e) {
            System.out.println( "Error \""+ e.toString()+ "\" on file "+outputFilename);
            e.printStackTrace() ;
            System.exit(-1) ;      //brutally exit the program
        }
    }
//==========================================
//other func
	public static boolean firstIsBigger(String s1,String s2) {
		StringTokenizer first = new StringTokenizer(s1,":" + " ");
		StringTokenizer sec = new StringTokenizer(s2,":" + " ");
		int num=Integer.valueOf(first.nextToken()).intValue()*100 + Integer.valueOf(first.nextToken()).intValue();
		int num2=Integer.valueOf(sec.nextToken()).intValue()*100 + Integer.valueOf(sec.nextToken()).intValue();
	//	System.out.println(num);
	//	System.out.println(num2);
		return num<num2;
	}
	
	public static boolean halfHourHasPassed(String order,String curr) {
		StringTokenizer first = new StringTokenizer(order,":" + " ");
		StringTokenizer sec = new StringTokenizer(curr,":" + " ");
		int numOrder=Integer.valueOf(first.nextToken()).intValue()*100 + Integer.valueOf(first.nextToken()).intValue();
		int numCurr=Integer.valueOf(sec.nextToken()).intValue()*100 + Integer.valueOf(sec.nextToken()).intValue();
		return (numCurr-numOrder)>=30;
	}
}

